/*
 * Copyright (c) 2021 Eshel.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package demo.android.myapplication

import android.os.Bundle
import android.view.MotionEvent
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
//    val colors = arrayOf(
//        "#EC9423", "#D42963", "#6333B1", "#38A288", "#3E9BEE", "#424DAF", "#745148", "#E44C21"
//    )
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        /*for (text in dataSource) {
            val child = TextView(this)
            val size = *//*Random.nextInt(16, 40)*//*16
            child.textSize = size.float
            val shap = RoundRectShape(
                floatArrayOf(3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp),
                null,
                floatArrayOf(3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp, 3.dp),
            )
            child.text = text
            child.setPadding(5.dp.int, 5.dp.int, 5.dp.int, 5.dp.int)
            child.gravity = Gravity.CENTER
            val d = ShapeDrawable(shap)
            d.paint.color = Color.parseColor(colors[Random.nextInt(0, colors.size - 1)])
            child.background = d
            val lp = ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
            lp.rightMargin = 5.dp.int
            lp.bottomMargin = 5.dp.int
            child.layoutParams = lp
            tag_layout.addView(child, lp)
        }*/
    }

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        return super.dispatchTouchEvent(ev)
    }

}